package net.wofly.sale.shoppingcart.entity;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import net.wofly.sale.commodity.domain.Commodity;

import javax.persistence.*;

/**
 * 购物车列表
 * @author lign
 * @version 1.0
 * @created 29-十月-2017 11:13:49
 */
@Data
@Entity
@Table(name = "sale_shoppingcart_cartlist")
@ApiModel(description = "购物车列表实体")
@AllArgsConstructor
public class CartList {

	/**
	 * 主键
	 */
	@Id
	private String cartListID;
	private Long modifyDate;
	private Integer num;
	private String shoppingCartID;
	
	private Integer shoppingCartType ;

	@ManyToOne
	@JoinColumn(name = "commodityID", referencedColumnName = "commodityID")
	private Commodity commodity;

	/**
	 * 小计
	 */
	@Transient
	private Double totalAmount;

	public CartList(){

	}

	public CartList(String cartListID,Integer shoppingCartType, Long modifyDate, Integer num, String shoppingCartID, Commodity commodity) {
		this.cartListID = cartListID;
		this.shoppingCartType = shoppingCartType ;
		this.modifyDate = modifyDate;
		this.num = num;
		this.shoppingCartID = shoppingCartID;
		this.commodity = commodity;
	}
	
	
}